<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateShopProfitTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_profit', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('shop_id')->comment('=shops.id');
            $table->integer('user_id')->comment('=users.id');
            $table->tinyInteger('shop_role')->comment('shop_role');
            $table->decimal('money','12','2')->comment('店铺收益');
            $table->string('comment')->comment('备注');
            $table->timestamps();
        });
        DB::statement("ALTER TABLE `shop_profit` comment '店铺收益表';");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('shop_profit');
    }
}
